package com.example.myapplication;

import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.viewpager.widget.ViewPager;

import com.example.myapplication.adapter.HomeVpAdapter;
import com.google.android.material.tabs.TabLayout;

public class HomeActivity extends AppCompatActivity {
    private ViewPager mViewPager;
    private TabLayout bottomNav;

    private HomeVpAdapter mVpAdapter;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home);

        mViewPager = findViewById(R.id.vp_content);
        bottomNav = findViewById(R.id.tl_bottom_nav);

        mVpAdapter = new HomeVpAdapter(getSupportFragmentManager());
        mViewPager.setAdapter(mVpAdapter);

        bottomNav.setupWithViewPager(mViewPager);
    }
}